﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using IPhonePlugin;


namespace RutTrichThongTin.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            ViewBag.Message = "Welcome to Feeder Website !";
            if (Session["ThongTinTyGia"] == null)
            {
                RutTrichTyGia RutTrichTiGiaNgoaiTe = new RutTrichTyGia();
                ThongTinTyGia ThongTinTyGia = RutTrichTiGiaNgoaiTe.RutTrichTyGiaNgoaiTe();
                Session["ThongTinTyGia"] = ThongTinTyGia;
            }            
            return View();
        }
        public ActionResult About()
        {
            return View();
        }

        public ActionResult ThayDoiTienTe(string LoaiTienTe)
        {
            bool isValid = false;
            ThongTinTyGia ThongTinTyGia=(ThongTinTyGia)Session["ThongTinTyGia"];
            if (ThongTinTyGia != null)
            {
                ThongTinTyGia.TyGiaHienTai = LoaiTienTe;
                Session["ThongTinTyGia"] = ThongTinTyGia;
                isValid = true;
            }
            var data = new
            {
                IsValidUserName = isValid,
            };
            return Json(data);
        }



    }
}
